﻿
@{
    ViewData["Title"] = "闲言碎语";
    Layout = "~/Views/Shared/_Layout.cshtml";
    IVBlog.Models.Info info = ViewBag.info;
}
<style>
    .none {
        display: none;
    }

    .block {
        display: block;
    }
</style>
@model IEnumerable<IVBlog.Models.Dynamic>
@section Scripts{
    <script>
        $('#example').tooltip();
        $('#example').tooltip({ boundary: 'window' })
    </script>
}
<style>
    .bgimg {
        background-image: url("../img/ROAME_2.jpg");
        background-size: cover;
    }
</style>
<div class="bgimg">
    <div class="jumbotron" style="background-color: rgba(255,255,255,.5);">
        <div class="row">
            <div class="col-sm-6">
                <h2 class="display-3">@info.InfoName</h2>
            </div>
            <div class="col-sm-6">
                <div class="row text-center" style="padding-top:30px">
                    <div class="col">
                        <h4>文章<span class="badge badge-success">@ViewBag.ArticleNum</span></h4>
                    </div>
                    <div class="col">
                        <h4>动态<span class="badge badge-warning">@ViewBag.DynamicNum</span></h4>
                    </div>
                    <div class="col">
                        <h4>评论<span class="badge badge-primary">@ViewBag.RemarkNum</span></h4>
                    </div>
                </div>
            </div>
        </div>
        <p class="lead">@info.Motto</p>
        <hr class="my-4">
        <p id="hitokoto_text">:D 一言获取中...</p>
        <p class="lead">
            <!--<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>-->
        </p>
    </div>
</div>
<div class="card">
    <div class="card-body">
        <button type="button" id="example" class="btn btn-secondary" data-toggle="tooltip" data-placement="right" title="这只是个按钮(*^▽^*)">
            我的动态
        </button>
    </div>
</div>
<ul class="list-group list-group-flush">
    @foreach (var item in Model)
    {
        <li class="list-group-item bg-transparent">
            <div class="row">
                <div class="col-sm-1 text-center">
                    <a href="#" class="header_logo">
                        <img src="~/img/IV.png" class="logo_img" alt="头像┗( ´・∧・｀)┛" />
                    </a>
                </div>
                <div class="card col-sm-11">
                    <div class="card-header bg-white">
                        <div>
                            <a href="~/Home/Index" class="card-link">@info.InfoName</a>
                            &nbsp;<span class="badge badge-secondary">@(string.Format("{0:D}", item.Dtime))</span>
                        </div>
                    </div>
                    <div class="card-body">
                        <div>@item.Dcontent</div>
                    </div>
                    <div class="card-footer bg-white">
                        <!--<a class="" @*data-toggle="collapse" href="#E@(item.DynamicId)"*@  data-toggle="modal" data-target="#exampleModal"
                           role="button" aria-expanded="false" aria-controls="collapseExample">
                            <i class="bi bi-chat-left"></i>
                        </a>-->
                        <a href="javascript:;" data-toggle="tooltip" title="o(￣▽￣)ｄ点赞" onclick="DLikes(this,@(item.DynamicId))"><i class="bi bi-heart">@item.Dlikes</i></a>
                        <a data-toggle="tooltip" title="点过赞啦(#^.^#)" class="none" id="none"><i class="bi bi-heart-fill" style="color:red"></i></a>
                    </div>
                </div>
            </div>
        </li>
    }
    <!--<li class="list-group-item bg-transparent">
        <div class="row">
            <div class="col-sm-1 text-center">
                <a href="#" class="header_logo">
                    <img src="~/img/IV.png" class="logo_img" alt="头像┗( ´・∧・｀)┛" />
                </a>
            </div>
            <div class="card col-sm-11">
                <div class="card-header bg-white">
                    <div>
                        <a href="~/Home/Index" class="card-link">IV</a>
                        &nbsp;<span class="badge badge-secondary">发表日期</span>
                    </div>
                </div>
                <div class="card-body">
                    <div>动态内容</div>
                </div>
                <div class="card-footer bg-white">
                    <a class="" data-toggle="collapse" href="#collapseExample1"
                       role="button" aria-expanded="false" aria-controls="collapseExample">
                        <i class="bi bi-chat-left"></i>
                    </a>
                    <a href="" data-toggle="tooltip" title="o(￣▽￣)ｄ点赞"><i class="bi bi-heart">点赞数</i></a>
                </div>
                <div class="card collapse" id="collapseExample1">
                    <div class="card-body">
                        <div class="card">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-sm-1 text-center">
                                        <a href="#" class="header_logo">
                                            <img src="~/img/IV.png" class="logo_img" alt="头像┗( ´・∧・｀)┛" />
                                        </a>
                                    </div>
                                    <div class="col-sm-11">
                                        <div>
                                            名字相关
                                            &nbsp;<a href="" data-toggle="tooltip" title="o(￣▽￣)ｄ点赞"><i class="bi bi-heart"></i></a>
                                            &nbsp;<span class="badge badge-secondary">评论日期</span>
                                        </div>
                                        <div>评论内容</div>
                                        <br />
                                        <div class="card">
                                            <div class="card-body">
                                                <div class="row">
                                                    <div class="col-sm-1 text-center">
                                                        <a href="#" class="header_logo">
                                                            <img src="~/img/IV.png" class="logo_img" alt="头像┗( ´・∧・｀)┛" />
                                                        </a>
                                                    </div>
                                                    <div class="col-sm-11">
                                                        <div>
                                                            名字相关
                                                            &nbsp;<a href="" data-toggle="tooltip" title="o(￣▽￣)ｄ点赞"><i class="bi bi-heart"></i></a>
                                                            &nbsp;<span class="badge badge-secondary">评论日期</span>
                                                        </div>
                                                        <div>回复内容</div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <br />
                                        <div class="card">
                                            <div class="card-body">
                                                <div class="row">
                                                    <div class="col-sm-1 text-center">
                                                        <a href="#" class="header_logo">
                                                            <img src="~/img/IV.png" class="logo_img" alt="头像┗( ´・∧・｀)┛" />
                                                        </a>
                                                    </div>
                                                    <div class="col-sm-11">
                                                        <div>
                                                            名字相关
                                                            &nbsp;<a href="" data-toggle="tooltip" title="o(￣▽￣)ｄ点赞"><i class="bi bi-heart"></i></a>
                                                            &nbsp;<span class="badge badge-secondary">评论日期</span>
                                                        </div>
                                                        <div>回复内容</div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="card">
                            <div class="card-body">
                                <form action="/" method="post">
                                    <div class="form-row">
                                        <div class="col">
                                            <input type="text" class="form-control" data-toggle="tooltip" title="姓名(昵称)" placeholder="姓名(昵称)">
                                        </div>
                                        <div class="col">
                                            <input type="text" class="form-control" data-toggle="tooltip" title="邮箱" placeholder="邮箱">
                                        </div>
                                        <div class="col">
                                            <input type="text" class="form-control" data-toggle="tooltip" title="网站或博客" placeholder="网站或博客">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="exampleFormControlTextarea1">写下您的评论吧！~~</label>
                                        <textarea class="form-control" id="exampleFormControlTextarea1"
                                                  data-toggle="tooltip" title="(*^▽^*)有什么想说的" rows="3" placeholder="说点什么">
                                    </textarea>
                                    </div>
                                    <button type="submit" class="btn btn-primary">提交评论！</button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </li>-->
</ul>
<div class="card" id="">
    <div class="card-footer">
        <h1>留言板</h1>
    </div>
    <div class="card-body">
        <div class="card">
            <div class="card-body" id="Remark">
                <form action="/Home/DRemarkAdd" method="post">
                    <div class="form-row">
                        <div class="col">
                            <input type="text" name="txtName" id="txtName" class="form-control" data-toggle="tooltip" title="姓名(昵称)" placeholder="姓名(昵称)">
                        </div>
                        <div class="col">
                            <input type="text" name="txtEmail" id="txtEmail" class="form-control" data-toggle="tooltip" title="邮箱" placeholder="邮箱">
                        </div>
                        <div class="col">
                            <input type="text" name="txtWeb" id="txtWeb" class="form-control" data-toggle="tooltip" title="网站或博客" placeholder="网站或博客">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleFormControlTextarea1">写下您的留言吧！~~</label>
                        <textarea class="form-control" id="txtContent" name="txtContent"
                                  data-toggle="tooltip" title="(*^▽^*)有什么想说的" rows="3" placeholder="说点什么"></textarea>
                    </div>
                    <button type="submit" class="btn btn-primary">提交留言！</button>
                </form>
            </div>
            @if (TempData["state"]!=null)
	        {
                <div class="card-body">
                    <h2>@TempData["state"]</h2>
                </div> 
                <script>
                    var Remark = document.getElementById("Remark");
                    Remark.setAttribute("class","none");
                </script>
	        } 
        </div>
    </div>
</div>

<script>
    function DLikes(obj, DynamicId) {
        var that = $(obj);
        $.ajax({
            type: 'post',
            url: '../Home/DLikes/' + DynamicId,
            success: function () {
                that.addClass("none");
                that.next().removeClass("none");
            }
        });
    }
</script>


